import Login from "../page/Login";
import Article from "../page/Article";
import Book from '../page/Book'

import { createBrowserRouter } from 'react-router-dom'
import Layout from "../page/Layout";
import Board from "../page/Board";
import About from "../page/About";
import NotFount from '../page/NotFound'

const router = createBrowserRouter([
    {
        path:'/',
        element:<Layout/>,
        // 配置嵌套路由
        children:[
            // 设置默认的二级路由
            {
                index:true,
                element:<Board/>
            },
            {
                path:'about',
                element:<About/>
            }
        ]
    },
    {
        path:'/login',
        element:<Login/>
    },
    {
        path:'/article',
        element:<Article/>
    },
    {
        path:'/book/:num/:tip',
        element:<Book/>
    },
    {
        path:'*',
        element:<NotFount/>
    }
])

export default router
